// TOWN DIALOGUE SCRIPT
//    Town 14: She-devil Lair

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

// note: she-devil will either be not mad, getting mad or mad.  if mad,
//  combat will start - no conversation...

begintalkscript;

variables;

short choice, mxt, mx;

// *** She-devil (ok) ***
begintalknode 1;
	state = -1;
	personality = 1406;
	nextstate = 2;
	condition = 1;
	question = "She-Devil";
	text1 = "Ahead of you is the infamous she-devil.  You feel a lustful stir as you approach.";
	text2 = "In her lair, from a distance, she seems to take on a strange green glow, turning her brown hair greenish.";
	text3 = "She speaks _Who dares bother me in my lair?_";
	text4 = "She awaits your response, seemingly hopeful your lust will not overtake you.";
	text5 = "The she-devil speaks _You have again come into my lair._";
	text6 = "_What is it you wish of me?_ she asks.";
	action = INTRO;
	code =
		set_flag(14, 5, 0); // reset just in case (always assume you're back in control)
	break;

begintalknode 2;
	state = 2;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) > 0;
	question = "Let's go to bed together.";
	text1 = "She seems sad as she helps you undress.";
	text2 = "After you have your fun, she morphs, then attacks you.";
	action = END_TALK;
	code =
		set_attitude(6, 10);
		alert_char(6);
		set_attitude(1001, 10);
		alert_char(1001);
	break;

begintalknode 3;
	state = 2;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) == 0;
	question = "Who are you?";
	text1 = "You feel your lust rise as she smiles at you _My name is unpronouncable._";
	text2 = "_You may call me 'she'._";
	text3 = "That smile along with the soulful eyes are dragging you down.";
	text4 = "In fact, you've succumbed to her wiles!";
	code =
		mxt = get_skill_total(39); // will power
		mx = get_highest_skill(39);
		if (get_ran(1, 1, mxt) < mx) // succumbed
			set_flag(14, 5, 1);
		if (get_flag(14, 5) == 0)
			remove_string(4);
	break;

begintalknode 4;
	state = 2;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) == 0;
	question = "Why are you here?";
	text1 = "She seems a bit sad as she answers _I have lost a doll that I would like back._";
	text2 = "_Sometime back, some explorers made it down to my home in the underworld._";
	text3 = "_As I hid, I dropped my doll my maker gave me.  They found it and left with it._";
	text4 = "_I managed to track them here, but lost track of them and the doll._";
	text5 = "_Henner provided me with this place, but I need to find my doll and return._";
	text6 = "_Unfortunately, those who meet me succumb to my nature and I have to kill them._";
	text7 = "_Why do they put me in this position?_ she wails.";
	text8 = "As she is talking, your lust rises and you succumb to her nature!";
	code =
		if (get_flag(14, 6) == 0)
			set_flag(14, 6, 1);
		mxt = get_skill_total(39); // will power
		mx = get_highest_skill(39);
		if (get_ran(1, 1, mxt) < mx) // succumbed
			set_flag(14, 5, 1);
		if (get_flag(14, 5) == 0)
			remove_string(8);
	break;

begintalknode 5;
	state = 2;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) == 0;
	question = "Why don't we get together.";
	text1 = "She looks aghast _You do not know what you are asking for._";
	text2 = "_Do not ask me again or I will hurt you._";
	text3 = "But the thought of being with her is too much for you.";
	code =
		mxt = get_skill_total(39); // will power
		mx = get_highest_skill(39);
		if (get_ran(1, 1, mxt) < mx) // succumbed
			set_flag(14, 5, 1);
		if (get_flag(14, 5) == 0)
			remove_string(3);
	break;
	
begintalknode 6;
	state = 2;
	personality = 1406;
	nextstate = 7;
	condition = (get_flag(14, 5) == 0) && (get_flag(14, 6) > 0) && (has_special_item(5) > 0);
	question = "I have your doll.";
	text1 = "She perks up _Can I have it?_ she asks.";
	text2 = "She asks again _Will you give it back to me?_";
	text3 = "_Give it to me now._ she demands.";
	text4 = "Her begging tips you over the edge.";
	code =
		clear_strings();
		inc_flag(14, 4, 1);
		add_string(get_flag(14, 4));
		if (get_flag(14, 4) < 3) {
			mxt = get_skill_total(39); // will power
			mx = get_highest_skill(39);
			if (get_ran(1, 1, mxt) < mx) // succumbed
				set_flag(14, 5, 1);
			if (get_flag(14, 5) > 0) {
				add_string(4);
				inc_flag(14, 4, -1); // reset counter...
			}
		}
	break;

begintalknode 7;
	state = 7;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) == 0;
	question = "Yes, here you go.";
	text1 = "The she-devil takes the doll from you, thanks you, then disappears.";
	text2 = "Her guards disappear also.";
	action = END_TALK;
	code =
		set_flag(50, 1, 1);
		take_special_item(5);
		set_items_not_property();
		erase_char(1001);
		put_effect_on_char(6, 9, 8, 0);
		run_animation_sound(10);
		erase_char(6);
		force_instant_terrain_redraw();
	break;

begintalknode 8;
	state = 7;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) == 0;
	question = "No, I think I'll hang onto it.";
	text1 = "She looks angry _Have it your way then._";
	text2 = "She turns so mad that her facial expression changes.  She don't look so pretty now!";
	action = END_TALK;
	code =
		if (get_flag(14, 4) < 3) {
			remove_string(2);
		}
		else {
			set_flag(14, 1, 1);
			set_char_dialogue_pic(6, 521, 0);
		}
	break;

begintalknode 9;
	state = 7;
	personality = 1406;
	nextstate = -1;
	condition = get_flag(14, 5) > 0;
	question = "Enough talk about the doll, lets do it.";
	text1 = "She seems a little ataken back by your forwardness.";
	text2 = "After an enjoyable time, she turns into a demon and attacks you.";
	action = END_TALK;
	code =
		set_attitude(6, 10);
		alert_char(6);
		set_attitude(1001, 10);
		alert_char(1001);
	break;

// *** She-devil (getting mad) ***
begintalknode 10;
	state = -1;
	personality = 1406;
	nextstate = 11;
	condition = 1;
	question = "She-Devil";
	text1 = "As the she-devil turns and faces you, you see her true colors.";
	text2 = "Since she is still angry, you are faced with a scary vision of hell.";
	text3 = "She growls _Why have you returned?_";
	text4 = "_Answer wisely and I may let you leave._ she adds.";
	text5 = "The she-devil is still angry at you and is reflected in her appearance.";
	text6 = "_What is it you want?_ she barks.";
	code =
		clear_strings();
		if (get_flag(14, 0) == 0) {
			set_flag(14, 0, 1);
			add_string(1);
			add_string(2);
			add_string(3);
			add_string(4);
		}
		else {
			add_string(5);
			add_string(6);
		}
	break;

begintalknode 11;
	state = 11;
	personality = 1406;
	nextstate = 12;
	condition = 1;
	question = "I still got your doll!";
	text1 = "_Give it to me!_ she demands.";
	code =
		inc_flag(14, 4, 1);
	break;

begintalknode 12;
	state = 12;
	personality = 1406;
	nextstate = -1;
	condition = 1;
	question = "OK, OK, here you go.";
	text1 = "She snatches it from you, gives you an angry stare, then disappears along with her guards.";
	action = END_TALK;
	code =
		set_flag(50, 1, 1);
		take_special_item(5);
		set_items_not_property();
		erase_char(1001);
		put_effect_on_char(6, 9, 8, 0);
		run_animation_sound(10);
		erase_char(6);
		force_instant_terrain_redraw();
	break;

begintalknode 13;
	state = 12;
	personality = 1406;
	nextstate = -1;
	condition = 1;
	question = "I don't think so.";
	text1 = "She seems to be getting angrier.";
	text2 = "In fact, that last no seemed to be the straw that broke the back.  She attacks.";
	action = END_TALK;
	code =
		if (get_flag(14, 4) < 6) {
			remove_string(2);
		}
		else {
			set_attitude(6, 10);
			alert_char(6);
			set_attitude(1001, 10);
			alert_char(1001);
		}
	break;
